

#include "setting.h"




AppSettingPage::AppSettingPage(Page* parent) :AppPage(parent)
{
  this->viewport = new Container(this);
  this->viewport->set_size(220, 260);

  this->viewport->set_flex_layout(LV_FLEX_FLOW_COLUMN, false, false, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER);



  Cell* cell_system_info = new Cell(this->viewport);
  cell_system_info->set_img(&ui_img_setting_png);
  cell_system_info->set_font(&ui_font_songti18);
  cell_system_info->set_text("系统信息");

  cell_system_info->set_click_event_cb([](void* user_data) {

    AppSettingPage* page = (AppSettingPage*) user_data;

    page->system_info_page = new SystemInfoPage(page);
    page->system_info_page->show();

    }, this);

  Cell* cell_system_update = new Cell(this->viewport);
  cell_system_update->set_img(&ui_img_setting_png);
  cell_system_update->set_font(&ui_font_songti18);
  cell_system_update->set_text("系统更新");


}

AppSettingPage::~AppSettingPage()
{



}


AppSettingPage* app_setting_page = NULL;

void app_setting_main(void* data)
{


  // if (app_setting_page != NULL)
  // {
  //   delete app_setting_page;
  // }

  Page* page = (Page*) data;
  printf("app_setting_main");
  app_setting_page = new AppSettingPage(page);
  app_setting_page->show();

}


void app_setting_init()
{
  app_manger.install("setting", app_setting_main, NULL, &ui_img_setting_png, lv_color_hex(THEME_COLOR_ORANGE));
}


